import java.net.ServerSocket;
import java.net.Socket;
import java.io.*;
import java.net.*;
import java.util.*;

public class Connection {

	public Connection() {
		
		try{
			
		
		s=new Socket("localhost",3306);
		s.setSoTimeout(20000);
		
			
		
		InputStream inStream = s.getInputStream();
		in = new Scanner(inStream);
		
		outStream = s.getOutputStream();
		out = new PrintWriter(outStream,true);
		
//		Runnable r = new ThreatListener(in);
//		Thread t = new Thread(r);
//		t.start();
		
		
		}catch (Exception e) {
			// TODO: handle exception
		}
		
		
		
		
		
			
			
			
		
		
		
		
	}
	
	public String[] send(String msg) 
	{
		out.println(msg);
		//out.flush();
		line=in.nextLine();
		String[] t={line.trim()};
		System.out.println("server:"+line.trim());
		if(line.length()>60)return t;
		return line.split(" ");
	}
	
	public void receive() throws IOException
	{
		
	}
	
	
	String line="";
	Socket s;
	Socket incoming;
	InputStream inStream;
	OutputStream outStream;
	Scanner in;
	PrintWriter out;
}
